﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;
using HYElectricKernel;

namespace HYRElectric.LightningCalculation
{
	public class Profile
	{
		public List<EdgeInfo> EdgeLoop
		{
			get
			{
				return this.m_Profile;
			}
			set
			{
				this.m_Profile = value;
			}
		}

		public Profile(Profile rhs)
		{
			this.m_Profile = rhs.m_Profile;
		}

		public Profile(List<EdgeInfo> profile)
		{
			this.m_Profile = profile;
		}

		public double Perimeter()
		{
			return 0.0;
		}

		public double Area()
		{
			List<XYZ> list = new List<XYZ>();
			foreach (EdgeInfo edgeInfo in this.m_Profile)
			{
				List<XYZ> list2 = edgeInfo.ConvertTo().Tessellate().ToList<XYZ>();
				for (int i = 1; i < list2.Count; i++)
				{
					list.Add(list2[i]);
				}
			}
			return Geometry.AoArea(list);
		}

		private List<EdgeInfo> m_Profile = new List<EdgeInfo>();
	}
}
